{template 'common/header'}

<ul class="nav nav-tabs">
	<li {if $operation == 'answer'}class="active"{/if}><a href="{php echo $this->createWebUrl('sitedata', array('op' => 'answer'))}"> 答题记录</a></li>
	<li {if $operation == 'prize'}class="active"{/if}><a href="{php echo $this->createWebUrl('sitedata', array('op' => 'prize'))}">红包记录</a></li>
</ul>
<script>
	require(['bootstrap'],function($){
		$('.btn').hover(function(){
			$(this).tooltip('show');
		},function(){
			$(this).tooltip('hide');
		});
	});
</script>

{if $operation == 'answer'}
<div class="main">
	<div class="category">
		<form action="" method="post" onsubmit="return formcheck(this)">
			<div class="panel panel-default">
				<div class="panel-body table-responsive">
					<table class="table table-hover">
						<thead>
							<tr>
								<th style="width:40px;" ><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" />全选</th>
								<th style="width:100px;">用户昵称</th>
								<th style="width:150px;">用户openid</th>
								<th style="width:150px;">答题时间</th>		
								<th style="width:150px;">答题情况</th>	
							</tr>
						</thead>
						<tbody>
						{loop $answerinfo $item}
						<tr>
							<td><input type="checkbox" name="checkbox[]"  value="{$item['id']}" /></td>
							<td>{$item['nickname']}</td>
							<td>{$item['openid']}</td>
							<td>{php echo date("m-d H:i",$item['time'])}</td>
							<td>
								{if $item['isright']==1}
								<span class='label label-success'>回答正确</span>
								{else}
								<span class='label label-danger'>回答错误</span>
								{/if}
							</td>
						</tr>
						{/loop}

						</tbody>
					</table>	
				</div>
			</div>
			<input class="btn btn-success" value= "删除" name="delateanswer"type="submit" onclick="return confirm('确认删除？');"/>
			<input type="hidden" name="token" value="{$_W['token']}" />
		</form>
		{$pager}
	</div>
</div>

{elseif $operation == 'prize'}
<div class="main">
	<div class="category">
		<form action="" method="post" onsubmit="return formcheck(this)">
			<div class="panel panel-default">
				<div class="panel-body table-responsive">
					<table class="table table-hover">
						<thead>
							<tr>
								<th style="width:40px;" ><input type="checkbox" onclick="var ck = this.checked;$(':checkbox').each(function(){this.checked = ck});" />全选</th>
								<th style="width:100px;">用户昵称</th>
								<th style="width:150px;">用户openid</th>
								<th style="width:80px;">时间</th>
								<th style="width:70px;">金额</th>							
							</tr>
						</thead>
						<tbody>
						{loop $prizedinfo $item}
						<tr>
							<td><input type="checkbox" name="checkbox[]"  value="{$item['id']}" /></td>
							<td>{$item['nickname']}</td>
							<td>{$item['openid']}</td>
							<td>{php echo date("m-d H:i",$item['time'])}</td>
							<td>{$item['number']}</td>
						</tr>
						{/loop}

						</tbody>
					</table>	
				</div>						
			</div>
			{$pager}
			<input class="btn btn-success" value= "删除" name="delateprize"type="submit" onclick="return confirm('确认删除？');"/>
			<input type="hidden" name="token" value="{$_W['token']}" />
		</form>
	</div>
</div>
{/if}


{template 'common/footer'}